Electronic apparatus and control method of the same

ABSTRACT

An electronic apparatus includes a first imaging unit, a second imaging unit with a focal length different from a focal length of the first imaging unit, and a reading unit configured to read information from an optical code image included in a captured image, and a control unit configured to perform control so as to, in a case where information based on the optical code image has been read by the reading unit from an image captured by the first imaging unit, execute processing corresponding to the read information, and in a case where information based on the optical code image has not been read by the reading unit from an image captured by the first imaging unit, to cause the reading unit to read information based on the optical code image, from an image captured by the second imaging unit, and execute processing corresponding to the read information.

BACKGROUND Field of the Disclosure

The present disclosure relates to an electronic apparatus that canrecognize optical code information, such as a two-dimensional code, by aplurality of imaging units, and a control method of an electronicapparatus.

Description of the Related Art

There has been known a technique used for advertisements, instructionmanuals, and production management in factories. In this technique, auser can access a web page or detailed information by reading a printedor displayed two-dimensional code (i.e., optical code information). Inrecent years, an electronic payment that uses a two-dimensional code hasbecome widely known as one of payment methods that use smartphones.Japanese Patent Application Laid-Open No. H10-134133 discusses atechnique of changing an optical zoom magnification by driving a lens inaccordance with a size of a barcode (one-dimensional code) included inan image that is captured by a reading device of an electronicapparatus, when reading the barcode.

However, in Japanese Patent Application Laid-Open No. H10-134133, a userhas to adjust a distance between the barcode and the reading device ofthe electronic apparatus until the distance at which an image of thebarcode can be captured in an appropriate size by performing opticalzoom by driving the lens. If a mechanism that can perform optical lensdriving is mounted on an electronic apparatus, the electronic apparatusneeds to have a certain degree of size. It is therefore difficult tomount the mechanism on a compact electronic apparatus. For this reason,when a barcode is read by a conventional reading device of an electronicapparatus, if the reading device of the electronic apparatus is locatedtoo close to or too far away from the barcode, the user has beensometimes required to bring the electronic apparatus away from or closeto the barcode until the reading device of the electronic apparatuscomes to a position at which the reading device can read the barcode.

SUMMARY

Some embodiments of the present disclosure are directed to reducing atime of operation performed by a user for bringing an electronicapparatus away from or close to an optical code image when theelectronic apparatus reads the optical code image.

According to an aspect of some embodiments, an electronic apparatusincludes a first imaging unit, a second imaging unit with a focal lengthdifferent from a focal length of the first imaging unit, and at leastone memory and at least one processor which function as a reading unitconfigured to read information from an optical code image included in acaptured image, and a control unit configured to perform control so asto, in a case where information based on the optical code image has beenread by the reading unit from an image captured by the first imagingunit, execute processing corresponding to the read information, and in acase where information based on the optical code image has not been readby the reading unit from an image captured by the first imaging unit, tocause the reading unit to read information based on the optical codeimage, from an image captured by the second imaging unit, and executeprocessing corresponding to the read information.

Further features of various embodiments will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are external views illustrating a smartphone accordingto an exemplary embodiment.

FIG. 2 is a block diagram illustrating a configuration of the smartphoneaccording to an exemplary embodiment.

FIGS. 3A, 3B, 3C, and 3D each illustrate a display example displayed ona display of the smartphone according to an exemplary embodiment.

FIGS. 4A and 4B are a flowchart illustrating control processing oftwo-dimensional code reading according to a first exemplary embodiment.

FIGS. 5A and 5B are a flowchart illustrating control processing oftwo-dimensional code reading according to a second exemplary embodiment.

FIG. 6 illustrates a display example of a quick response (QR) code®serving as one of two-dimensional codes.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments will be described in detail below with referenceto the accompanying drawings.

It is to be noted that the following exemplary embodiments are eachmerely examples and can be appropriately modified or changed dependingon individual constructions and various conditions of apparatuses towhich the embodiments are applied. Thus, some embodiments are notlimited to the following exemplary embodiments.

Hereinafter, exemplary embodiments will be described with reference tothe drawings.

FIGS. 1A and 1B are external views illustrating a smartphone 100 servingas an example of a device (electronic apparatus) to which the presentembodiment can be applied. FIG. 1A is a front view of the smartphone 100and FIG. 1B is a rear view of the smartphone 100. In FIGS. 1A and 1B, adisplay 105 is a display unit that is provided on the front side of thesmartphone 100, and displays images and various types of information. Atouch panel 106 a is a touch operation member and can detect a touchoperation performed on a display surface (operation surface) of thedisplay 105. The smartphone 100 can display, on the display 105, a liveview image (LV image) captured by a rear camera 114 or a front camera115. The rear camera 114 includes a telecamera 114 a, a standard camera114 b, and a super-wide angle camera 114 c, which will be describedbelow. A power button 106 b is an operation member included in anoperation unit 106 and can switch light-on/off of the display 105. Ifthe power button 106 b is continuously pressed (long press) for acertain period of time, such as three seconds, power ON/OFF of thesmartphone 100 can be switched. A volume plus button 106 c and a volumeminus button 106 d are volume buttons for controlling the volume ofsound and voice output from an audio output unit 112. If the volume plusbutton 106 c is pressed, volume is increased, and if the volume minusbutton 106 d is pressed, volume is decreased. In an image capturingstandby state in a camera use state, the volume plus button 106 c or thevolume minus button 106 d also functions as a shutter button that issuesan image capturing instruction upon being pressed. The user canarbitrarily set a specific function to be executed when the power button106 b and the volume minus button 106 d are simultaneously pressed, orwhen the volume minus button 106 d is quickly pressed several times. Ahome button 106 e is an operation button for displaying, on the display105, a home screen, i.e., a start screen of the smartphone 100. Whenvarious applications are started up and used in the smartphone 100, bypressing the home button 106 e, the operating various applications canbe temporarily closed and the home screen can be displayed. While aphysically-pressable button is used as the home button 106 e in thepresent exemplary embodiment, a touchable button with a similar functionthat is displayed on the display 105 may be used as the home button 106e instead of a physical button. An audio output terminal 112 a is anearphone jack and is a terminal that outputs audio signal to earphonesor an external speaker. A speaker 112 b is a speaker that is built in amain body and outputs sound and voice. When a terminal, such as anearphone cord, for outputting sound and voice from the smartphone 100 isnot attached to the audio output terminal 112 a, the sound and voice isoutput from the speaker 112 b.

FIG. 2 is a block diagram illustrating a configuration example of thesmartphone 100 according to the present exemplary embodiment. A centralprocessing unit (CPU) 101, a memory 102, a nonvolatile memory 103, arear camera image processing unit 104, the display 105, the operationunit 106, a recording medium interface (I/F) 107, an external I/F 109,and a communication I/F 110 are connected to an internal bus 150. Theaudio output unit 112, an orientation detection unit 113, the rearcamera 114, the front camera 115, and a front camera image processingunit 116 are also connected to the internal bus 150. The componentsconnected to the internal bus 150 can exchange data with each other viathe internal bus 150.

The CPU 101 is a control unit that controls the entire smartphone 100,and includes at least a processor or a circuit. The memory 102 is, forexample, a random access memory (RAM) (volatile memory that uses asemiconductor device). In accordance with a program stored in thenonvolatile memory 103, for example, the CPU 101 controls each componentof the smartphone 100 using the memory 102 as a work memory. Thenonvolatile memory 103 stores image data, audio data, other types ofdata, and various programs for operating the CPU 101. The nonvolatilememory 103 is, for example, a flash memory or a read-only memory (ROM).

Based on the control of the CPU 101, the rear camera image processingunit 104 performs various types of image processing and subjectrecognition processing on an image captured by the rear camera 114. Therear camera image processing unit 104 includes a telecamera imageprocessing unit 104 a, a standard camera image processing unit 104 b,and a super-wide angle camera image processing unit 104 c respectivelycorresponding to the telecamera 114 a, the standard camera 114 b, andthe super-wide angle camera 114 c. The respective image processing unitsperform processing on images captured by the respective cameras. In thepresent exemplary embodiment, the three rear cameras respectivelyinclude the image processing units, but not all the three rear camerasneed to be individually provided with the respective image processingunits. For example, any two cameras may share one image processing unit,or three cameras may share one image processing unit. In a similarmanner, the front camera image processing unit 116 performs processingon an image captured by the front camera 115. Each image processing unitcan also perform various types of image processing on an image stored inthe nonvolatile memory 103 or a recording medium 108, a video signalacquired via the external I/F 109, and an image acquired via thecommunication I/F 110. Image processing to be performed by each imageprocessing unit includes analog-to-digital (A/D) conversion processing,digital-to-analog (D/A) conversion processing, encoding processing,compression processing, decoding processing, enlargement/reductionprocessing (resizing), noise reduction processing, and color conversionprocessing of image data. Each image processing unit may include adedicated circuit block for performing specific image processing. Therear camera image processing unit 104 can also perform decodingprocessing, which is a series of processes of detecting a feature of atwo-dimensional code to be described below, determining the existence ofthe two-dimensional code, and reading information held by thetwo-dimensional code. The decoding processing will be described below inthe description of a quick response (QR) code. The rear camera imageprocessing units 104 may be integrated into one processing block, andindependently perform image processing on images captured by thecameras, by parallel processing or time division processing. Dependingon the type of image processing, the CPU 101 can perform imageprocessing in accordance with a program without using each imageprocessing unit.

Based on the control of the CPU 101, the display 105 displays an imageand a graphical user interface (GUI) screen constituting a GUI. Inaccordance with a program, the CPU 101 generates a display controlsignal, generates a video signal for displaying a video image on thedisplay 105, and controls each component of the smartphone 100 to outputthe video signal to the display 105. Based on the output video signal,the display 105 displays a video image. The smartphone 100 may includeonly an interface for outputting a video signal for displaying a videoimage on the display 105, and the display 105 may be an external monitor(e.g., television).

The operation unit 106 is an input device for receiving a useroperation, including a character information input device, such as akeyboard, a pointing device, such as a mouse or a touch panel, a button,a dial, a joystick, a touch sensor, and a touchpad. The touch panel isan input device planarly formed so as to be overlaid on the display 105,and outputs coordinate information corresponding to a touched position.The operation unit 106 includes the touch panel 106 a, the power button106 b, the volume plus button 106 c, the volume minus button 106 d, andthe home button 106 e, described above.

The recording medium 108, such as a memory card, a compact disc (CD), ora digital versatile disk (DVD), can be attached to the recording mediumI/F 107. Based on the control of the CPU 101, the recording medium I/F107 reads data from the attached recording medium 108 and writes datainto the attached recording medium 108. The recording medium 108 may bea built-in storage incorporated in the smartphone 100. The external I/F109 is an interface for connecting with an external device wirelessly orvia a wired cable, and inputting and outputting a video signal and anaudio signal. The communication I/F 110 is an interface forcommunicating with an external device or an internet 111, andtransmitting and receiving various types of data, such as a file and acommand.

The audio output unit 112 outputs voice and sound in a moving image ormusic data, operation sound, ringtone, and various types of notificationsound. The audio output unit 112 includes the speaker 112 b and theaudio output terminal 112 a for connecting earphones, but the audiooutput unit 112 may output audio signal by wireless communication.

The orientation detection unit 113 detects the orientation of thesmartphone 100 with respect to a gravitational force direction, and theinclination of the orientation with respect to the axes of yaw, roll,and pitch. Based on the orientation detected by the orientationdetection unit 113, it can be determined whether the smartphone 100 ishorizontally held, whether the smartphone 100 is vertically held,whether the smartphone 100 faces up, whether the smartphone 100 facesdown, or whether the smartphone 100 is at an oblique orientation. As theorientation detection unit 113, at least one of an acceleration sensor,a gyro sensor, a geomagnetic sensor, a direction sensor, or an altitudesensor can be used, or a plurality of sensors can also be used incombination.

The rear camera 114 is a camera disposed on the opposite side of thedisplay 105 on the casing of the smartphone 100. A focal length of thetelecamera 114 a is longer than a focal length of the standard camera114 b, and the telecamera 114 a can capture an image of telephoto sidemore than the standard camera 114 b can capture. A focal length of thesuper-wide angle camera 114 c is shorter than a focal length of thestandard camera 114 b, and the super-wide angle camera 114 c can capturea wider-angle image than an image captured by the standard camera 114 b.In other words, focal lengths become shorter in the order of thetelecamera 114 a, the standard camera 114 b, and the super-wide anglecamera 114 c, and field-of-views accordingly become wider. In thepresent exemplary embodiment, the telecamera 114 a is appearing toinclude a lens having a mechanism of being optically zoomed to apredetermined magnification, but may include a lens having a mechanismwith a magnification changeable by the user. The front camera 115 is acamera disposed on the same surface as the display 105 on the casing ofthe smartphone 100. The three rear cameras 114, including the telecamera114 a, the standard camera 114 b, and the super-wide angle camera 114 c,can simultaneously perform an image capturing operation. The three rearcameras 114 can simultaneously perform an image capturing operation asdescribed above, but not all the three rear cameras 114 necessarilyoperate at the same time, and any two rear cameras of the three rearcameras 114 may operate, or one rear camera can independently operate.Live view videos captured by the rear camera 114 and the front camera115 can be both displayed on the display 105. By the operation performedon the touch panel 106 a, a video image captured by which camera is tobe displayed on the display 105 can be selected. More specifically, ifthe telecamera 114 a is selected, an image larger than that of an imagecaptured by the standard camera 114 b can be displayed on the display105. If the standard camera 114 b is selected, an image with an anglewider than that of an image captured by the telecamera 114 a, andenlarged more than that of an image captured by the super-wide anglecamera 114 c, can be displayed. If the super-wide angle camera 114 c isselected, an image captured at an angle wider than both imagesrespectively captured by the telecamera 114 a and the standard camera114 b can be displayed. Alternatively, depending on which of the rearcamera 114 and the front camera 115 is used, whether to capture an imageof what a user sees or whether to capture an image of the userherself/himself can be selected.

The operation unit 106 includes the touch panel 106 a. The CPU 101 candetect the following operations performed on the touch panel 106 a orthe states thereof.

-   An operation of a finger or a stylus that has not been in touch with    the touch panel 106 a newly touching the touch panel 106 a, i.e.,    the start of a touch on the touch panel 106 a (hereinafter, referred    to as “Touch-Down”).-   A state where a finger or a stylus is in touch with the touch panel    106 a (hereinafter, referred to as “Touch-On”).-   An operation of a finger or a stylus moving over the touch panel 106    a while being in touch with the touch panel 106 a (hereinafter,    referred to as “Touch-Move”).-   An operation of a finger or a stylus that has been in touch with the    touch panel 106 a detaching from the touch panel 106 a, i.e., the    end of a touch on the touch panel 106 a (hereinafter, referred to as    “Touch-Up”).-   A state where nothing touches the touch panel 106 a (hereinafter,    referred to as “Touch-Off”).

If the Touch-Down is detected, the Touch-On is simultaneously detected.After the Touch-Down, normally, the Touch-On continues to be detecteduntil the Touch-Up is detected. Also when the Touch-Move is detected,the Touch-On is simultaneously detected. Even if the Touch-On isdetected, the Touch-Move is not detected unless a touch position moves.If the Touch-Up of all the fingers or styluses that have been in touchis detected, the Touch-Off is detected.

These operations and states, and a position coordinate on the touchpanel 106 a at which a finger or a stylus is in touch, are notified tothe CPU 101 via an internal bus. Based on the notified information, theCPU 101 determines what type of operation (touch operation) has beenperformed on the touch panel 106 a. As for the Touch-Move, a movingdirection of a finger or a stylus moving on the touch panel 106 a canalso be determined for each perpendicular component and horizontalcomponent on the touch panel 106 a based on a change in positioncoordinate. If it is detected that the Touch-Move has been performed fora predetermined distance or more, it is determined that a slideoperation has been performed. An operation of swiftly moving a finger bya certain amount of distance with the finger being in touch on the touchpanel 106 a, and then detaching the finger in this state, will bereferred to as a flick. In other words, the flick is an operation ofswiftly moving the finger over the touch panel 106 a like a flip. If itis detected that the Touch-Move has been performed at a predeterminedspeed or more for a predetermined distance or more, and the Touch-Up isdetected in this state, it can be determined that a flick has beenperformed (it can be determined that a flick has been performedsubsequent to the slide operation). Furthermore, a touch operation ofsimultaneously touching a plurality of locations (e.g., two points), andbringing the touch positions closer to each other will be referred to as“pinch-in”, and a touch operation of bringing the touch positions awayfrom each other will be referred to as “pinch-out”. The pinch-out andthe pinch-in will be collectively referred to as a pinch operation (orsimply “pinch”). As the touch panel 106 a, a touch panel of any of thefollowing various types may be used: a resistive type touch panel, acapacitive type touch panel, a surface acoustic wave type touch panel,an infrared type touch panel, an electromagnetic induction type touchpanel, an image recognition type touch panel, and an optical sensor typetouch panel. Depending on the types, some touch panels detect a touchupon detecting contact with the touch panels while the other touchpanels detect a touch upon detecting the proximity of a finger or astylus to the touch panels. A touch panel of any type of them may beused.

A two-dimensional code refers to a code in a display format holdinginformation in a horizontal direction and a vertical direction incontrast to a one-dimensional code, such as a barcode, that holdsinformation only in a horizontal direction. Major two-dimensional codesinclude a matrix two-dimensional code and a stacked two-dimensionalcode. A QR code® is a representative code of a matrix two-dimensionalcode, and PDF417 is a representative code of a stacked two-dimensionalcode. As compared with a one-dimensional code, a two-dimensional codecan hold a larger amount of information. In particular, a QR code canstore not only numbers but also multilingual data, such as alphabeticalcharacters and Chinese characters. Because a QR code can be read by animage sensor, the QR code does not always require a dedicated readingdevice as other two-dimensional codes require, and can be easily read bya camera serving as an imaging unit included in a mobile phone or asmartphone.

As described above, a QR code is a matrix type two-dimensional code, andis a pattern image formed by vertically and horizontally arraying cells602 each being a small square, as illustrated in FIG. 6. Encodingprocessing is performed on various symbols, such as numbers,alphabetical characters, and Chinese characters, and a QR code iscreated by a combination of the cells 602 and an array of the cells 602.Patterns like symbols 601, each called a cutout symbol, are arranged atthree corners of a square. Based on the cutout symbols, the square isrecognized as a QR code. More specifically, the symbols 601 serving ascutout symbols are detected from a captured image, and a size of a QRcode is detected based on the detected symbols 601. A cell distributionpattern formed by the cells 602 in the detected size of the QR code isdetected, and the distribution pattern is interpreted. Information heldby the QR code is thereby read. A series of processes of searching forthe symbols 601 serving as cutout symbols, from an image, detecting acell distribution pattern, and reading information will be referred toas decoding processing.

Based on the symbols 601 serving as cutout symbols, the CPU 101 not onlyrecognizes a QR code and detects a size, but also detects inclinationand deformation of the QR code. In the present exemplary embodiment tobe described below, whether a QR code falls within an image capturingrange is determined by recognizing the symbols 601. In this case, forcorrectly reading information held by a QR code, as described above, itis necessary to accurately read a distribution pattern formed by thecells 602 of the QR code. For example, when a QR code is to be readusing a smartphone, if a distribution pattern formed by the cells 602fails to be accurately recognized due to a too long distance between acamera of the smartphone and the QR code or a dark image capturinglocation, information cannot be read from the QR code. In this case, thedecoding processing cannot be performed. Thus, for reading informationheld by a QR code, i.e., for executing the decoding processing, it isnecessary to accurately read a distribution pattern formed by the cells602. As for the number of cells in a QR code existing in the currentera, there exist the number of vertical cells and the number ofhorizontal cells of 21×21 cells to 177×177 cells increasing every 4cells. The QR code illustrated in FIG. 6 includes 21×21 cells. As thenumber of cells increases, a larger amount of information can be held.

In these days, various types of information can be easily obtained byusing a QR code. For example, by printing or displaying a QR code on anadvertisement or an instruction manual, the user who reads the QR codecan easily access a desired web page. A redundancy code, for correctingan error occurred when a part of data fails to be read or a part of datais erroneously read, is added to a QR code. With this configuration, theQR code is more resistant to dirt and deformation as compared with othercodes. The QR code is therefore widely used for the management of aproduction line in a production site, such as a factory. Furthermore, asan electronic payment that uses a credit card instead of cash, such asbills, has become frequently-used, a QR code payment for making paymentby reading a QR code using a smartphone has started to be widely knownas one of electronic payments. When such a QR code payment becomeswidespread, it is demanded that the user is enabled to smoothly makepayment without taking time in reading QR code.

In the present exemplary embodiment, control processing of controlling acamera in reading a two-dimensional code in the smartphone 100 will bedescribed.

In a first exemplary embodiment, a description will be given of anexample in which the three rear cameras 114, including the telecamera114 a, the standard camera 114 b, and the super-wide angle camera 114 c,are simultaneously driven, and a two-dimensional code, which is opticalcode information, is read by the most appropriate camera among the rearcameras 114. FIGS. 4A and 4B are a flowchart illustrating controlprocessing of driving the rear cameras 114 and the rear camera imageprocessing units 104, and reading a two-dimensional code, i.e.,performing the decoding processing of a two-dimensional code. Thecontrol processing is implemented in the smartphone 100 by the CPU 101executing a program stored in the nonvolatile memory 103. The flowchartillustrated in FIGS. 4A and 4B are started when a camera application isstarted up in the smartphone 100 and the smartphone 100 is in an imagecapturing standby state. An application to be started up is not limitedto the above-described camera application. The flowchart may be startedwhen a two-dimensional code reading function of an application forperforming decoding processing of a two-dimensional code is started upand the smartphone 100 is in the image capturing standby state. FIGS.3A, 3B, 3C, and 3D each illustrate a display example displayed on thedisplay 105 when a two-dimensional code is read.

In S401, the CPU 101 starts image capturing using the three rearcameras, 114 including the telecamera 114 a, the standard camera 114 b,and the super-wide angle camera 114 c, and starts the driving of thethree rear camera image processing units 104 a to 104 c.

In S402, the CPU 101 displays, on the display 105, an LV image capturedby the standard camera 114 b among the three rear cameras 114 driven inS401. FIG. 3A illustrates a display example displayed at this time. Inthe first exemplary embodiment, irrespective of which rear camera 114executes reading of a code 304 included in an LV image, an LV imagecaptured by the standard camera 114 b is displayed on the display 105.As an indicator indicating an image capturing executable range of thetelecamera 114 a, a frame 301 a and a marker 302 are displayed in anoverlaid manner on the LV image displayed on the display 105. The marker302 is an item indicating a center position of an image that can becaptured by the telecamera 114 a, and a center position of an image thatcan be captured by the super-wide angle camera 114 c. The framedisplayed as an image capturing executable range of the telecamera 114 ais only required to be visually recognizable as a range. The frame maybe a solid-line frame like the frame 301 a illustrated in FIG. 3A, ormay be a dotted-line frame. Like a frame 301 b illustrated in FIG. 3B,the frame may be displayed with a semi-transmissive mask applied on anoutside region of the image capturing executable range. The marker 302illustrated in FIG. 3A is only required to be a marker that can bevisually recognized by the user as a center of an image that can becaptured by the telecamera 114 a. The marker 302 may be a cross-shapedmarker like the marker 302, or may be a marker such as a point. Theframe 301 a and the marker 302 need not be displayed in an overlaidmanner on an LV image. When the code 304 is read, displaying the frame301 a and the marker 302 in an overlaid manner on the LV image displayedon the display 105 helps the user to visually recognize a position atwhich the code 304 is to be framed for enabling the smartphone 100 toread the code 304. By displaying on the display 105 an LV image capturedby the standard camera 114 b, the user can view a wider range than arange obtained when the user views an LV image captured by thetelecamera 114 a, irrespective of which camera performs recognition. Inthis way, the user can easily perform framing when capturing an image ofthe code 304. By displaying the frame 301 a, which is an image capturingexecutable range of the telecamera 114 a, in an overlaid manner on theLV image of the standard camera 114 b, if the code 304 falls within theframe 301 a, the code 304 is less likely to fall outside a field-of-viewwhen recognized by the telecamera 114 a. In other words, if the code 304falls within the indicator of the frame 301 a, irrespective of whichrear camera 114 performs recognition, the code 304 becomes more likelyto be recognized. In addition, by displaying a message like a guide 303illustrated in FIG. 3A, on the display 105 in addition to the frame andthe marker, it becomes easier for the user to capture an image of thecode 304 within the indicator of the frame 301 a, and the code 304becomes more likely to be recognized.

In S403, using the standard camera image processing unit 104 b, the CPU101 determines whether an optical code image, e.g., a subject appearingto be a two-dimensional code, is included in an image captured by thestandard camera 114 b. If the two-dimensional code is included in thecaptured image (YES in S403), the processing proceeds to S404. If thetwo-dimensional code is not included in the captured image (NO in S403),the processing proceeds to S405. As described above, if the CPU 101 candetermine whether the symbol 601 is included, the CPU 101 can determinewhether a subject included in a captured image is a two-dimensionalcode. For example, even if a two-dimensional code is located too faraway from the standard camera 114 b (i.e., too small to read informationtherefrom), the symbols 601 can be easily detected from a far positionbecause the symbols 601 are larger than the cells 602. Even when not allthe three symbols 601 are included in a captured image, if one or twosymbols 601 are included in a captured image, the subject is more likelyto be a two-dimensional code. In other words, in S403, the CPU 101determines whether the symbol 601 is included in an image captured bythe standard camera 114 b.

In S404, the CPU 101 determines whether the two-dimensional code isreadable by the standard camera image processing unit 104 b from theimage captured by the standard camera 114 b. If the two-dimensional codeis readable (YES in S404), the processing proceeds to S411. If thetwo-dimensional code is unreadable (NO in S404), the processing proceedsto S405. As described above, “the two-dimensional code is readable”means that a distribution pattern of the cells 602 forming thetwo-dimensional code is detectable. In other words, it means that thedecoding processing of the two-dimensional code is executable. “Thedecoding processing of the two-dimensional code is executable” meansthat an image of the two-dimensional code has been captured asaccurately as the distribution pattern of the cells 602 is detectable.Even when the symbol 601 has been detected and the two-dimensional codehas been recognized in S403, if the standard camera 114 b is located toofar away from the two-dimensional code, the distribution pattern cannotbe accurately detected. Alternatively, if the standard camera 114 b islocated too close to the two-dimensional code and not all the threesymbols 601 are detectable, size recognition of the two-dimensional codein the decoding processing cannot be performed. Thus, the decodingprocessing cannot be performed also when the standard camera 114 b islocated too close to the two-dimensional code.

In S405, using the telecamera image processing unit 104 a, the CPU 101determines whether a subject appearing to be a two-dimensional code isincluded in an image captured by the telecamera 114 a, e.g., determineswhether the symbol 601 is included in the captured image. If thetwo-dimensional code is included in the captured image (YES in S405),the processing proceeds to S406. If the two-dimensional code is notincluded in the captured image (NO in S405), the processing proceeds toS407.

In S406, the CPU 101 determines whether the two-dimensional code isreadable by the telecamera image processing unit 104 a from the imagecaptured by the telecamera 114 a, e.g., determines whether adistribution pattern of the cells 602 of a subject appearing to be atwo-dimensional code is detectable. If the distribution pattern isdetectable (YES in S406), the processing proceeds to S411. If thedistribution pattern is undetectable (NO in S406), the processingproceeds to S407.

In S407, the CPU 101 determines whether the three symbols 601 areincluded in the image captured by the standard camera 114 b in S403. Ifthe three symbols 601 are included in the captured image (YES in S407),the processing proceeds to S408. If the three symbols 601 are notincluded in the captured image (NO in S407), the processing proceeds toS409.

In S408, the CPU 101 displays a two-dimensional code indicator, such asa frame 305 illustrated in FIG. 3A, on the subject appearing to be atwo-dimensional code determined in S403, and the processing returns toS404. Because it has been determined to be YES in S407, the threesymbols 601 are included in the image captured by the standard camera114 b. Thus, an image of the entire two-dimensional code has beencaptured by the standard camera 114 b. However, it is considered thatthe decoding processing cannot be performed because the two-dimensionalcode is too small to detect a distribution pattern of the cells 602 bythe standard camera 114 b (i.e., the distance between the standardcamera 114 b and the two-dimensional code is too long). From thedetermination to be NO in S405 and S406 in addition to the determinationto be YES in S407, it may be considered that a subject appearing to be atwo-dimensional code falls outside the frame 301 a, which is an imagecapturing executable range of the telecamera 114 a, as illustrated inFIG. 3A. Even if the CPU 101 tries to recognize the distribution patternof the cells 602 in such a state using the telecamera 114 a, an image ofthe entire code 304 cannot be captured because the code 304 fallsoutside the image capturing executable range of the telecamera 114 a.Accordingly, even if the code 304 is large enough, information cannot beread. Accordingly, by accentuating the code 304 that is a subjectappearing to be a two-dimensional code, using a two-dimensional codeindicator like the frame 305, it becomes easier for the user to visuallyrecognize the code 304. A message like the guide 303 is also displayed.By the code 304 and the guide 303, the user is prompted to frame thecode 304 into the image capturing executable range of the telecamera 114a. If the user frames the code 304 into the image capturing executablerange of the telecamera 114 a, it becomes easier to recognize the code304 by both the standard camera image processing unit 104 b and thetelecamera image processing unit 104 a. Furthermore, if the marker 302indicating the center of an LV image is displayed on the display 105,the user intuitively performs image capturing in such a manner as tomatch the two-dimensional code with the marker 302, and the code 304becomes more likely to be recognized. The guide 303 may be displayedfrom when an LV image is started to be displayed on the display 105, orthe display of the guide 303 may be started at the same timing as thedisplay timing of the frame 305 in S408.

In S409, using the super-wide angle camera image processing unit 104 c,the CPU 101 determines whether a subject appearing to be atwo-dimensional code is included in an image captured by the super-wideangle camera 114 c, e.g., determines whether the symbol 601 is includedin the captured image. If the two-dimensional code is included in thecaptured image (YES in S409), the processing proceeds to S410. If thetwo-dimensional code is not included in the captured image (NO in S409),the processing returns to S403. Because it has been determined to be NOin S407, it can be seen that three symbols 601 are not included in theimage captured by the standard camera 114 b. For this reason, it isconsidered that an image of the code 304 is captured in a too large sizeand an image of only a part of the code 304 is captured as illustratedin FIG. 3C (i.e., distance between the standard camera 114 b and thecode 304 is too short). Thus, the CPU 101 tries to capture an image of awider range using the super-wide angle camera 114 c. Even in such acase, owing to the marker 302, the user is prompted to frame the code304 into the central part of the image capturing range of the super-wideangle camera 114 c as described above in S408, and the code 304 can berecognized easily from the image captured by the super-wide angle camera114 c.

In S410, the CPU 101 determines whether the two-dimensional code isreadable by the super-wide angle camera image processing unit 104 c fromthe image captured by the super-wide angle camera 114 c, i.e., adistribution pattern of the cells 602 of a subject appearing to be atwo-dimensional code is detectable. If the distribution pattern isdetectable (YES in S410), the processing proceeds to S411. If thedistribution pattern is undetectable (NO in S410), the processingreturns to S403.

In S411, the CPU 101 determines whether the two-dimensional codeindicator displayed in S408 is displayed. If the two-dimensional codeindicator is displayed (YES in S411), the processing proceeds to S412.If the two-dimensional code indicator is not displayed (NO in S411), theprocessing proceeds to S413.

In S412, the CPU 101 changes a display mode of the frame 305, which isthe two-dimensional code indicator, that has been displayed in S408. InS407, the code 304 is not clearly recognized as a two-dimensional codeand is determined to be a subject appearing to be a two-dimensionalcode. In other words, the frame 305 displayed in S408 is merely atwo-dimensional code indicator for notifying the user that the subjectis a subject appearing to be a two-dimensional code, and is not atwo-dimensional code indicator for indicating that a two-dimensionalcode has been read. Accordingly, if a two-dimensional code has been readin S404, S406, or S410, the color of the frame 305 may be changed, forexample, from white to yellow, or a frame surrounding the entiretwo-dimensional code may be displayed instead of a frame having onlyfour corners, for notifying the user that the two-dimensional code hasbeen read. With such a change in display mode, the user can understandthat the rear camera image processing unit 104 has been able to read thetwo-dimensional code.

In S413, because a distribution pattern of the cells 602 of the code 304has been read in S404, S406, or S410, the CPU 101 performs the decodingprocessing. The CPU 101 displays, on the display 105, a result obtainedby the decoding processing. More specifically, the CPU 101 displays, onthe display 105, information held by the two-dimensional code. Forexample, if information held by the code 304 is a uniform resourcelocator (URL) indicating an access destination of a web page, a URL,which is access information, is displayed as in a dialog box 308illustrated in FIG. 3D, and a confirmation screen for confirming whetherto access the web page is displayed. If the user touches a guide 306,the smartphone 100 accesses the web page. If the user touches a guide307, it is assumed that the user does not desire to access the web pageor desires to reread a two-dimensional code, and the state returns tothe image capturing standby state as illustrated in FIG. 3A. In thepresent exemplary embodiment, when the smartphone 100 accesses a webpage, the dialog box 308 as illustrated in FIG. 3D is displayed, and theconfirmation screen is displayed, but the confirmation screen may notneed to be displayed. The smartphone 100 may access the URL, which isinformation held by the two-dimensional code, without displaying theconfirmation screen, and may open the web page immediately after thetwo-dimensional code is read. The user may be allowed to arbitrarily setwhether to display the confirmation screen or directly open the webpage. If a two-dimensional code holds text information, the textinformation is displayed in a portion in the dialog box 308 in which theURL is displayed. In the present exemplary embodiment, the descriptionhas been given of a configuration of reading various types ofinformation using an application that can read various two-dimensionalcodes. However, in some cases, reading is performed using an applicationthat reads only a two-dimensional code holding specific information. Insuch a case, if a two-dimensional code holding information other thanthe specific information that can be read only by the above-describedspecific application is read, a warning may be displayed in the dialogbox 308, or the image capturing standby state may be continued withoutdisplaying a warning.

In S414, the CPU 101 determines whether the image capturing standbystate has ended. If the image capturing standby state has ended (YES inS414), this control flow ends. If the image capturing standby state hasnot ended (NO in S414), the processing returns to S403. The case wherethe image capturing standby state has ended includes a case where theuser has ended the camera application, and a case where a screentransitions to a different screen other than an image capturing standbyscreen after the decoding processing has been performed in S413. In bothcases, the user is assumed to have ended the reading of atwo-dimensional code, and this control flow ends. If the image capturingstandby screen continues to be displayed, it is assumed that atwo-dimensional code is to be continuously read.

As described above with reference to FIGS. 3A, 3B, 3C, and 3D, and thecontrol flow illustrated in FIGS. 4A and 4B, the three rear cameras 114,including the telecamera 114 a, the standard camera 114 b, and thesuper-wide angle camera 114 c, and the rear camera image processingunits 104, are simultaneously driven, and a two-dimensional code isread. By simultaneously driving the three rear cameras 114, it ispossible to quickly and easily access information using a camera thathas read a two-dimensional code, without the user performing a switchingoperation of the rear cameras 114. By displaying an LV image captured bythe standard camera 114 b, irrespective of which camera has read atwo-dimensional code, the user can view a wider range than an imagecaptured by the telecamera 114 a, and easily frame a two-dimensionalcode. In the first exemplary embodiment, because the three rear cameras114 are simultaneously driven, a switching operation of the cameras isnot performed. Thus, if any of the rear cameras 114 has succeeded inreading a two-dimensional code, the decoding processing can beperformed. If the rear camera 114 is located too close to the code 304as illustrated in FIG. 3C, the recognition and the reading of atwo-dimensional code are performed by the super-wide angle camera 114 c.In such a case, if the user frames a two-dimensional code based on theframe 301 a and the marker 302, any of the three rear cameras 114 caneasily recognize the two-dimensional code. For this reason, an LV imagecaptured by the standard camera 114 b is displayed. In this way, usingthe three rear cameras 114, a two-dimensional code can be read with awider range of focal length. Therefore, the user can reduce an operationof bringing a reading device of an electronic apparatus away from orclose to the two-dimensional code.

In a second exemplary embodiment, the description will be given of anexample in which the three rear cameras 114 are individually driven byswitching the rear cameras 114 one by one, and control is performed insuch a manner that a two-dimensional code, which is optical codeinformation, can be recognized by the most appropriate camera. FIGS. 5Aand 5B are a flowchart illustrating control processing of individuallydriving the rear cameras 114 of the smartphone 100 one by one andreading a two-dimensional code. The control processing is implemented inthe smartphone 100 by the CPU 101 executing a program stored in thenonvolatile memory 103. The flowchart illustrated in FIGS. 5A and 5B isstarted when a camera application is started up in the smartphone 100and the smartphone 100 is in an image capturing standby state. Anapplication to be started up is not limited to the above-describedcamera application. The flowchart may be started when a two-dimensionalcode reading function of a two-dimensional code readable application forrecognizing a two-dimensional code is started up and the smartphone 100is in the image capturing standby state. FIGS. 3A, 3B, 3C, and 3D eachillustrate a display example displayed on the display 105 when atwo-dimensional code is read.

In S501, the CPU 101 drives the standard camera 114 b and the standardcamera image processing unit 104 b, and starts image capturing using thestandard camera 114 b. In S401 in the first exemplary embodiment, theCPU 101 starts the driving of the telecamera 114 a, the standard camera114 b, the super-wide angle camera 114 c, the telecamera imageprocessing unit 104 a, the standard camera image processing unit 104 b,and the super-wide angle camera image processing unit 104 c. Differentfrom this operation, in S501, the CPU 101 drives only the standardcamera 114 b and the standard camera image processing unit 104 b, anddoes not drive the telecamera 114 a, the telecamera image processingunit 104 a, the super-wide angle camera 114 c, and the super-wide anglecamera image processing unit 104 c at this timing. The CPU 101 starts todisplay an LV image captured by the standard camera 114 b, on thedisplay 105. Similar to S402, a display example displayed at this timeis illustrated in FIG. 3A. In the second exemplary embodiment, the frame301 a needs not be displayed.

In S502, similar to S403, using the standard camera image processingunit 104 b, the CPU 101 determines whether an optical code image, i.e.,a subject appearing to be a two-dimensional code, is included in animage captured by the standard camera 114 b. If the two-dimensional codeis included in the captured image (YES in S502), the processing proceedsto S503. If the two-dimensional code is not included in the capturedimage (NO in S502), the processing proceeds to S504.

In S503, similar to S404, the CPU 101 determines whether thetwo-dimensional code is readable by the standard camera image processingunit 104 b from the image captured by the standard camera 114 b. If thetwo-dimensional code is readable (YES in S503), the processing proceedsto S514. If the two-dimensional code is unreadable (NO in S503), theprocessing proceeds to S505.

In S504, the CPU 101 determines whether a predetermined time has elapsedsince the driving of the standard camera 114 b has been started in S501.If the predetermined time has elapsed (YES in S504), the processingproceeds to S505. If the predetermined time has not elapsed (NO inS504), the processing returns to S502. If it is determined in S502 thata subject appearing to be a two-dimensional code is not included in theimage captured by the standard camera 114 b, it is considered that theuser might have just started up the camera application and have notframed a two-dimensional code into an image capturing executable rangeyet. For this reason, a time from when the driving of the standardcamera 114 b has been started is measured, and if the predetermined timehas elapsed, it is assumed that a two-dimensional code is not includedin the image capturing executable range of the standard camera 114 b, orthe two-dimensional code is too small, and the processing proceeds toS505. For example, a time about 5 seconds is assumed to be thepredetermined time, but the predetermined time may be a time shorterthan 5 seconds or a time longer than 5 seconds, or may be arbitrarilysettable by the user. The measured time is reset upon the driving stopof the standard camera 114 b or reading execution of a two-dimensionalcode.

In S505, the CPU 101 stops the driving of the standard camera 114 b andthe standard camera image processing unit 104 b, and starts the drivingof the telecamera 114 a and the telecamera image processing unit 104 a.Since a two-dimensional code has been determined in S503 to beunreadable even though a subject appearing to be a two-dimensional codehas been recognized in S502 from the image captured by the standardcamera 114 b, it can be assumed that the two-dimensional code is notlarge enough to read information therefrom. Since the two-dimensionalcode is not large enough, the code 304 can be recognized as atwo-dimensional code based on the symbols 601, but the shape formed bythe cells 602 cannot be accurately recognized and information cannot beread. Thus, by switching the standard camera 114 b to the telecamera 114a, the two-dimensional code is enlarged and read. Since the driving ofthe standard camera 114 b has been stopped, an LV image captured by thetelecamera 114 a is displayed on the display 105. The marker 302indicating the center of the LV image is continuously displayed in anoverlaid manner on the LV image.

In S506, similar to S405, using the telecamera image processing unit 104a, the CPU 101 determines whether a subject appearing to be atwo-dimensional code is included in an image captured by the telecamera114 a. If the two-dimensional code is included in the captured image(YES in S506), the processing proceeds to S507. If the two-dimensionalcode is not included in the captured image (NO in S506), the processingproceeds to S508.

In S507, similar to S406, the CPU 101 determines whether thetwo-dimensional code is readable by the telecamera image processing unit104 a from the image captured by the telecamera 114 a. If thetwo-dimensional code is readable (YES in S507), the processing proceedsto S514. If the two-dimensional code is unreadable (NO in S507), theprocessing proceeds to S509.

In S508, the CPU 101 determines whether a predetermined time has elapsedsince the driving of the telecamera 114 a has been started in S505. Ifthe predetermined time has elapsed (YES in S508), the processingproceeds to S509. If the predetermined time has not elapsed (NO inS508), the processing returns to S506. A time from when the driving ofthe telecamera 114 a has been started in S505 is measured. As describedabove in S504, a time, for example about 5 seconds, is assumed to be thepredetermined time, but the predetermined time may be a time shorterthan 5 seconds or a time longer than 5 seconds, or may be arbitrarilysettable by the user. The predetermined time in S508 may be set to atime different from the predetermined time set in S504. The measuredtime is reset upon the driving stop of the telecamera 114 a or theexecution of the decoding processing of a two-dimensional code.

In S509, similar to S407, the CPU 101 determines whether the threesymbols 601 are included in the image captured by the telecamera 114 ain S505. If the three symbols 601 are included (YES in S509), theprocessing proceeds to S510. If not the three symbols 601 are included(NO in S509), the processing proceeds to S511.

In S510, similar to S408, the CPU 101 displays a two-dimensional codeindicator, like the frame 305 illustrated in FIG. 3A, on the subjectappearing to be a two-dimensional code that has been determined in S506,and the processing returns to S503.

In S511, the CPU 101 stops the driving of the telecamera 114 a and thetelecamera image processing unit 104 a, and starts the driving of thesuper-wide angle camera 114 c and the super-wide angle camera imageprocessing unit 104 c. Based on S502, S503, S506, and S507, an image ofthe entire two-dimensional code might fail to be captured, for exampleas illustrated in FIG. 3C, because the distance between thetwo-dimensional code and the rear camera 114 is too short. In this case,because the image of the entire two-dimensional code has not beencaptured even with use of the standard camera 114 b in S503, byswitching the telecamera 114 a to the super-wide angle camera 114 c, animage capturing executable range is widened to capture the image of theentire two-dimensional code. Since the driving of the telecamera 114 ahas been stopped, an LV image capture by the super-wide angle camera 114c is displayed on the display 105. The marker 302 indicating the centerof the LV image is continuously displayed in an overlaid manner on theLV image.

In S512, similar to S409, using the super-wide angle camera imageprocessing unit 104 c, the CPU 101 determines whether a subjectappearing to be a two-dimensional code is included in an image capturedby the super-wide angle camera 114 c. If the two-dimensional code isincluded in the captured image (YES in S512), the processing proceeds toS513. If the two-dimensional code is not included in the captured image(NO in S512), the processing returns to S501.

In S513, similar to S410, the CPU 101 determines whether thetwo-dimensional code is readable by the super-wide angle camera imageprocessing unit 104 c from the image captured by the super-wide anglecamera 114 c. If the two-dimensional code is readable (YES in S513), theprocessing proceeds to S514. If the two-dimensional code is unreadable(NO in S513), the processing returns to S501.

In S514, similar to S411, the CPU 101 determines whether thetwo-dimensional code indicator displayed in S510 is displayed. If thetwo-dimensional code indicator is displayed (YES in S514), theprocessing proceeds to S515. If the two-dimensional code indicator isnot displayed (NO in S514), the processing proceeds to S516.

In S515, similar to S412, the CPU 101 changes a display mode of theframe 305, which is the two-dimensional code indicator, that has beendisplayed in S510.

In S516, similar to S413, the CPU 101 decodes the two-dimensional coderead in S503, S507, or S513, and displays the decoded result on thedisplay 105.

In S517, similar to S414, the CPU 101 determines whether the imagecapturing standby state has ended. If the image capturing standby statehas ended (YES in S517), the control flow ends. If the image capturingstandby state has not ended (NO in S517), the processing returns toS501.

As described above with reference to FIGS. 3A, 3B, 3C, and 3D and thecontrol flow illustrated in FIGS. 5A and 5B, the three rear cameras 114,including the telecamera 114 a, the standard camera 114 b, and thesuper-wide angle camera 114 c, are individually driven to read atwo-dimensional code. Since the three rear cameras 114 are automaticallyswitched based on a positional relationship between the rear camera 114and a two-dimensional code, the two-dimensional code can be read by themost appropriate camera without the user switching the rear cameras 114.There are the following two conditions as a switching condition of therear camera 114. The first one is a case where information cannot beread from a two-dimensional code although a shape (symbol 601) appearingto be a two-dimensional code is included in an image captured by any oneof the rear cameras 114. The second one is a case where a subjectappearing to be a two-dimensional code is not included in an imagecaptured by any one of the rear cameras 114 and a predetermined time haselapsed. In a case where at least one of the above-described twoconditions is satisfied, if the standard camera 114 b, for example, isdriven among the rear cameras 114, the driving of the standard camera114 b is stopped and the driving of the telecamera 114 a is started.Since an LV image is also switched along with the switching of the rearcamera 114, the user can identify a camera that currently captures animage of a two-dimensional code. By the user framing a two-dimensionalcode to match the marker 302, even if the user does not clearly identifya driven camera among the three rear cameras 114, a two-dimensional codecan be easily recognized. Since the three rear cameras 114 areindividually driven, as compared with a case where all the three rearcameras 114 are driven together, power consumption can be reduced. Inthis way, using the three rear cameras 114, a two-dimensional code canbe read with a wider range of focal length. Therefore, the user canreduce an operation of bringing a reading device of an electronicapparatus away from or close to the two-dimensional code.

By displaying, on the LV images, the marker 302 indicating the center ofLV images captured by the three rear cameras 114, if the user frames thecode 304 with reference to the marker 302, even when the camera isautomatically switched, the code 304 is highly likely to fall within animage capturing range. If the code 304 falls within an image capturingrange, recognition is more likely to be performed quickly.

In the present exemplary embodiment, the description has been given ofan example in which, simultaneously or individually using the three rearcameras 114, reading of a printed or displayed two-dimensional code,which is optical code information, is facilitated, but the presentexemplary embodiment is not limited to this. A target to be read is onlyrequired to be optical code information. For example, a one-dimensionalcode may be read instead of a two-dimensional code. A target to be readmay be a pattern image created by various patterns that can holdinformation irrespective of the dimensional. The present exemplaryembodiment can be applied not only to a two-dimensional code but also toa subject, such as a human or an animal, as a target to be recognized inthe present exemplary embodiment. More specifically, in the smartphone100 including cameras that can recognize a subject, such as a human oran animal, the three rear cameras 114 are simultaneously or individuallydriven and image capturing is started. Even though a subject cannot beclearly recognized by the standard camera 114 b, if a moving object oran object appearing to be a subject can be recognized, the standardcamera 114 b is switched to the telecamera 114 a, and a subject is to berecognized by the telecamera 114 a. If a subject is recognizable by thetelecamera 114 a, the subject that has been recognized by the telecamera114 a is recognized as a subject and image capturing is performed. If asubject has been unrecognizable even though the telecamera 114 a isused, the telecamera 114 a is switched to the super-wide angle camera114 c, and the subject is recognized by the super-wide angle camera 114c. Even if the present exemplary embodiment is applied to a subject,such as a human or an animal, not to a two-dimensional code as describedabove, a similar effect can be obtained. In other words, an image of asubject can be captured in an optimum size irrespective of a positionalrelationship between a camera and the subject, and the subject can beeasily framed.

In the above-described present exemplary embodiment, control isperformed in such a manner that a two-dimensional code can be recognizedwithout the user caring about a positional relationship between a cameraand the two-dimensional code. In this way, because the most appropriatecamera reads the two-dimensional code without the user caring about apositional relationship between a camera and the two-dimensional code,the user can easily cause the two-dimensional code to be read under morediversified situations. Furthermore, since an LV image is displayed onthe display 105 while an image of a two-dimensional code is beingcaptured, by capturing an image of the two-dimensional code so as tofall onto the LV image, the smartphone 100 can recognize thetwo-dimensional code using a desirable camera. In the first exemplaryembodiment, irrespective of which camera among simultaneously-driventhree cameras reads a two-dimensional code, an LV image captured by thestandard camera 114 b is displayed on the display 105. Thus, as comparedwith a case where an LV image captured by the telecamera 114 a isdisplayed, the user can frame a two-dimensional code while viewing awider range. In the second exemplary embodiment, because an LV imagecaptured by a driven camera is displayed, an image of a two-dimensionalcode can be captured while the user recognizes a driven camera.

The above-described various types of control that have been described tobe performed by the CPU 101 may be performed by one piece of hardware,or the entire apparatus may be controlled by a plurality of pieces ofhardware (e.g., a plurality of processors or circuits) sharingprocessing.

The exemplary embodiments have been described in detail, but someembodiments are not limited to these specific exemplary embodiments, andvarious configurations are also included in some embodiments withoutdeparting from the spirit of the disclosure. A part of theabove-described exemplary embodiments may be appropriately combined. Anexample in which the disclosure is applied to a smartphone has beendescribed, but an application example is not limited to this example.The present disclosure can be applied to any electronic apparatus aslong as the electronic apparatus includes imaging units and can readoptical code information from a captured image. More specifically, thepresent disclosure can be applied to a personal computer, a tablet, apersonal digital assistance (PDA), a digital camera, a portable imageviewer, a printer apparatus including a display, a digital photo frame,a music player, a game machine, and an electronic book reader.

Other Embodiments

Some embodiment(s) can also be realized by a computer of a system orapparatus that reads out and executes computer-executable instructions(e.g., one or more programs) recorded on a storage medium (which mayalso be referred to more fully as a ‘non-transitory computer-readablestorage medium’) to perform the functions of one or more of theabove-described embodiment(s) and/or that includes one or more circuits(e.g., application specific integrated circuit (ASIC)) for performingthe functions of one or more of the above-described embodiment(s), andby a method performed by the computer of the system or apparatus by, forexample, reading out and executing the computer-executable instructionsfrom the storage medium to perform the functions of one or more of theabove-described embodiment(s) and/or controlling the one or morecircuits to perform the functions of one or more of the above-describedembodiment(s). The computer may comprise one or more processors (e.g.,central processing unit (CPU), micro processing unit (MPU)) and mayinclude a network of separate computers or separate processors to readout and execute the computer-executable instructions. Thecomputer-executable instructions may be provided to the computer, forexample, from a network or the storage medium. The storage medium mayinclude, for example, one or more of a hard disk, a random-access memory(RAM), a read only memory (ROM), a storage of distributed computingsystems, an optical disk (such as a compact disc (CD), digital versatiledisc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memorycard, and the like.

While the present disclosure has described exemplary embodiments, it isto be understood that some embodiments are not limited to the disclosedexemplary embodiments. The scope of the following claims is to beaccorded the broadest interpretation so as to encompass all suchmodifications and equivalent structures and functions.

This application claims priority to Japanese Patent Application No.2019-147447, filed Aug. 9, 2019, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An electronic apparatus comprising: a firstimaging unit; a second imaging unit with a focal length different from afocal length of the first imaging unit; and at least one memory and atleast one processor which function as: a reading unit configured to readinformation from an optical code image included in a captured image; anda control unit configured to perform control so as to, in a case whereinformation based on the optical code image has been read by the readingunit from an image captured by the first imaging unit, executeprocessing corresponding to the read information, and in a case whereinformation based on the optical code image has not been read by thereading unit from an image captured by the first imaging unit, to causethe reading unit to read information based on the optical code image,from an image captured by the second imaging unit, and executeprocessing corresponding to the read information.
 2. The electronicapparatus according to claim 1, wherein the control unit performscontrol so that image capturing is simultaneously performed by at leastthe first imaging unit and the second imaging unit.
 3. The electronicapparatus according to claim 2, wherein the control unit performscontrol so as to display, on a display unit, a live view image capturedby the first imaging unit, without displaying, on the display unit, alive view image captured by the second imaging unit, in a state whereimage capturing is simultaneously performed by the first imaging unitand the second imaging unit.
 4. The electronic apparatus according toclaim 1, wherein a focal length of the first imaging unit is shorterthan a focal length of the second imaging unit, and wherein the controlunit displays a first indicator indicating an image capturing executablerange of the second imaging unit, on a live view image captured by thefirst imaging unit.
 5. The electronic apparatus according to claim 1,wherein the control unit performs control so as to start image capturingusing the second imaging unit in place of the first imaging unitperforming image capturing, in response to the optical code imagesatisfying a specific condition in a state where image capturing isbeing performed by any one of at least the first imaging unit and thesecond imaging unit.
 6. The electronic apparatus according to claim 5,wherein the specific condition is at least one of a state where aspecific shape indicating a feature of the optical code image has beenrecognized and information based on the optical code image has not beenread by the reading unit, or a state where the specific shape has notbeen recognized and a predetermined time has elapsed.
 7. The electronicapparatus according to claim 1, wherein the control unit performscontrol so as to switch image capturing from image capturing performedby the first imaging unit to image capturing performed by the secondimaging unit, without a user performing a switching operation.
 8. Theelectronic apparatus according to claim 1, wherein the control unitperforms control so as to display a second indicator indicating a centerof an image to be captured by the second imaging unit, on a live viewimage captured by the first imaging unit.
 9. The electronic apparatusaccording to claim 1, further comprising a third imaging unit, whereinthe control unit performs control, in a case where information based onthe optical code image has not been read by the reading unit from animage captured by the first imaging unit and an image captured by thesecond imaging unit, so as to cause the reading unit to read informationbased on the optical code image, from an image captured by the thirdimaging unit, and execute processing corresponding to the readinformation.
 10. The electronic apparatus according to claim 9, whereina focal length of the third imaging unit is shorter than a focal lengthof the first imaging unit.
 11. The electronic apparatus according toclaim 1, wherein the processing corresponding to the read information isprocessing of displaying the information.
 12. The electronic apparatusaccording to claim 1, wherein the processing corresponding to the readinformation is, in a case where the read information is accessinformation regarding a specific access destination, processing ofaccessing the specific access destination.
 13. The electronic apparatusaccording to claim 1, wherein the control unit displays a message forprompting a user to move an optical code image into a first indicatorindicating an image capturing executable range of the second imagingunit.
 14. The electronic apparatus according to claim 1, wherein thecontrol unit performs control so as to display a third indicator on theoptical code image read by the reading unit.
 15. The electronicapparatus according to claim 1, wherein the optical code image is aprinted or displayed pattern image.
 16. The electronic apparatusaccording to claim 15, wherein the optical code image is a barcode or aquick response (QR) code.
 17. A control method of an electronicapparatus including a first imaging unit, a second imaging unit with afocal length different from a focal length of the first imaging unit, atleast one memory, and at least one processor, the control methodcomprising: reading information from an optical code image included in acaptured image; and performing control so as to, in a case whereinformation based on the optical code image has been read in the readingfrom an image captured by the first imaging unit, execute processingcorresponding to the read information, and in a case where informationbased on the optical code image has not been read in the reading from animage captured by the first imaging unit, read information based on theoptical code image, in the reading from an image captured by the secondimaging unit, and execute processing corresponding to the readinformation.
 18. A non-transitory computer-readable storage mediumstoring a program for causing a computer that includes a first imagingunit and a second imaging unit with a focal length different from afocal length of the first imaging unit to function as an electronicapparatus comprising: a reading unit configured to read information froman optical code image included in a captured image; and a control unitconfigured to perform control so as to, in a case where informationbased on the optical code image has been read by the reading unit froman image captured by the first imaging unit, execute processingcorresponding to the read information, and in a case where informationbased on the optical code image has not been read by the reading unitfrom an image captured by the first imaging unit, to cause the readingunit to read information based on the optical code image, from an imagecaptured by the second imaging unit, and execute processingcorresponding to the read information